package com.sjl.crowd.service.impl;

import com.sjl.crowd.domain.Admin;
import com.sjl.crowd.domain.AdminExample;
import com.sjl.crowd.mapper.AdminMapper;
import com.sjl.crowd.service.AdminService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author ShiJieLin
 * @Date 2021/12/18 17:10
 * @Version 1.0
 */
@Service
public class AdminServiceImpl implements AdminService {

    private final AdminMapper adminMapper;

    public AdminServiceImpl(AdminMapper adminMapper) {
        this.adminMapper = adminMapper;
    }

    @Override
    public void saveAdmin(Admin admin) {
        adminMapper.insert(admin);
    }

    @Override
    public List<Admin> listAll() {
        return adminMapper.selectByExample(new AdminExample());
    }
}
